<?php

class PlayerController extends Zend_Controller_Action {

    public function init() {

    }

    public function indexAction() {

    }

    public function searchAction() {
        $results = "";
        $squad_id = $this->_getParam('squad_id');
        $by = $this->_getParam('by'); // alphabet
        $with = $this->_getParam('with'); // all | national
        switch($with) {
            case "all":
                $players = PlayerServices::GetAllPlayers();
                break;
            case "national":
                $players = PlayerServices::GetPlayersByNational($by);
                break;
        }
        echo PlayerServices::PrepareResultSet($players, $squad_id);
        exit;
    }

   

}

?>
